-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement v1 file format #299
Conversation
This is necessary to counteract a recent change in `cargo-c`
The feature `static` should not be used when APPLgrid has been compiled with ROOT support, because ROOT doesn't support static linking
Co-authored-by: Felix Hekhorn <[email protected]>
|
||
/// TODO | ||
#[must_use] | ||
pub fn fill_index(&self, value: f64) -> Option<usize> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prefix is a bit confusing, i.e. fill_index
and fill_limits
are not similar to each other - maybe insert_at_index
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or actually, just insert
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are similar to each other in that they both refer to Grid::fill
. This method has a parameter observable
which is an f64
, which is being checked if it falls inside the limits returned by BinsWithFillLimits::fill_limits
. If that's not the case, BinsWithFillLimits::fill_index
returns None
, else Some(index)
where index
is the result. Of course, this should be part of the documentation that is still missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I misunderstood (so yes documentation) ... mmm I still think it's not a perfect name (as usual this is a subjective thing); how about search_fill_index
? if you disagree please just resolve this comment
|
||
/// Error type returned by [`BinRemapper::from_str`] | ||
#[derive(Debug, Error)] | ||
pub enum Bla { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub enum Bla { | |
pub enum BinRemapperStrError { |
nur um das klar zu stellen: mein Standardname is 50% Bla
und 50% Blub
🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that still has to be changed.
@@ -124,17 +124,17 @@ bitflags! { | |||
#[derive(Clone, Deserialize, Serialize)] | |||
pub struct Grid { | |||
subgrids: Array3<SubgridEnum>, | |||
channels: Vec<Channel>, | |||
bin_limits: BinLimits, | |||
bwfl: BinsWithFillLimits, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we call it just bins
here please? We don't care about the implementation details inside grid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not an implementation detail. Every bin has effectively two sets of limits:
- The N-dimensional actual bin limits that also the user sees. These mustn't overlap, but they allow 'gaps' between them, also they must all have the same dimensions;
- Fill limits: these are one-dimensional limits, the 'fill limits', that only
Grid::fill
uses. These are as many limits as there are bins plus one more and all values must be ascending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said I suppose we can find a better name. I'd like to avoid Bins
though, because this struct has a method fn bins()
and then the code would have a lot of grid.bins().bins()
invocations, which is a bit odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said I suppose we can find a better name.
that was my main concern - bins_config
?
impl FromStr for BinsWithFillLimits { | ||
type Err = Bla; | ||
|
||
fn from_str(s: &str) -> Result<Self, Bla> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to split this looong function into 4-5 smaller ones? naively it seems there is a clear path step 1 -> step 2 -> step 3 -> ... which act in isolation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can split this function into smaller ones, but I don't see that making it more readable. But let me try to improve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to me it would be more readable - because then there will be a clear input, a clear task, and a clear output. Needless to say that this would also be good for unit testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that if this could be broken into smaller functions that'd be great as right now it is a bit difficult to read.
Feature TODOs:
Channel
to support arbitrarily many PIDs. This is implemented with commits f32902a, 2417c92 and 03f2dc6.Order
should support a fragmentation scale. Started with commits 5e281ae and 02e48e9.1
(no scale variation),3
(vary all scales with the same factor),7
and9
(assuming that there's no fragmentation scale), and17
and27
(assuming there's a fragmentation scale)PackedArray
struct that we wrote some time ago.v0
PineAPPL grids and convert the subgrids into the new subgrid types.LHAPDFNAME+p
for polarized andLHAPDFNAME+f
for fragmentation function andLHAPDFNAME+pf
orLHAPDFNAME+fp
for bothCode TODOs:
Order
tou8
channel!
to arbitrarily many PIDsZEUS_2JET_319GEV_374PB-1_DIF_ETQ2_BIN6
(available in the same location where also the other test data is)BinInfo
, and have instead fill limits (1d limits that only concernGrid::fill
) and bin limits (n-dimensional limits)Grid::evolve_info
lagrange_subgrid
PackedQ1X2SubgridV1
NodeValues
Mu2
D=N
forgeneral_tensor_mul
inevolution.rs
Grid::merge
check if grids are compatible with each other before mergingSetType:
EvolveInfo::frg1
andFkTable::frg0
@Radonirinaunimi Test remaining new features of PineAPPL 1.0 #325D=3
forgeneral_tensor_mul
inevolution.rs
@Radonirinaunimi Test remaining new features of PineAPPL 1.0 #325CAPI TODO:
GridOptFlags
(see commit 54a59f3)pineappl_channel_*
topineappl_channels_*
?-v1.cpp
suffix of example programs to.cpp
and rename the previous example programs from.cpp
to-deprecated.cpp
. This should clarify that the use ofv0
functions is deprecated (but still works!)Fortran module TODO:
Python API:
pyo3-0.22.5
, this possible now sincenumpy-0.22.0
was released. Figure out what new features we can leverage from0.22.x
(see its CHANGELOG):#![allow(unsafe_op_in_unsafe_fn)]
3.7
inpyproject.toml
General:
CHANGLOG.md
entries fromv0.8.x
branch